#! /bin/bash

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/setup_udev.sh"

# firefly@aqua:~/ws_vision$ v4l2-ctl --list-ctrls -d /dev/video_4060h 
#                      brightness 0x00980900 (int)    : min=-64 max=64 step=1 default=0 value=0
#                        contrast 0x00980901 (int)    : min=0 max=95 step=1 default=0 value=0
#                      saturation 0x00980902 (int)    : min=0 max=255 step=1 default=58 value=64
#                             hue 0x00980903 (int)    : min=1 max=60 step=1 default=50 value=1
#  white_balance_temperature_auto 0x0098090c (bool)   : default=1 value=0
#                           gamma 0x00980910 (int)    : min=64 max=300 step=1 default=100 value=100
#                            gain 0x00980913 (int)    : min=1 max=240 step=1 default=100 value=32
#            power_line_frequency 0x00980918 (menu)   : min=0 max=3 default=1 value=2
#       white_balance_temperature 0x0098091a (int)    : min=2800 max=6500 step=1 default=4600 value=4600
#                       sharpness 0x0098091b (int)    : min=1 max=33768 step=1 default=2000 value=1
#          backlight_compensation 0x0098091c (int)    : min=0 max=4 step=1 default=0 value=0
#                   exposure_auto 0x009a0901 (menu)   : min=0 max=3 default=3 value=1
#               exposure_absolute 0x009a0902 (int)    : min=1 max=10000 step=1 default=78 value=50

DEV="/dev/video_4060h"
v4l2-ctl -d $DEV --set-ctrl=brightness=0
v4l2-ctl -d $DEV --set-ctrl=contrast=0
v4l2-ctl -d $DEV --set-ctrl=saturation=64
v4l2-ctl -d $DEV --set-ctrl=hue=0
v4l2-ctl -d $DEV --set-ctrl=white_balance_temperature_auto=0
v4l2-ctl -d $DEV --set-ctrl=gamma=100
v4l2-ctl -d $DEV --set-ctrl=gain=1
v4l2-ctl -d $DEV --set-ctrl=power_line_frequency=1
v4l2-ctl -d $DEV --set-ctrl=white_balance_temperature=4600
v4l2-ctl -d $DEV --set-ctrl=sharpness=3000
v4l2-ctl -d $DEV --set-ctrl=backlight_compensation=0
v4l2-ctl -d $DEV --set-ctrl=exposure_auto=1
v4l2-ctl -d $DEV --set-ctrl=exposure_absolute=150